package com.Bigbluebook.Service;


import com.Bigbluebook.entity.Message;
import java.util.List;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface MessageService {
    @POST("/messages/send")
    Call<Message> sendMessage(@Query("senderId") Long senderId, @Query("receiverId") Long receiverId, @Query("content") String content);

    @DELETE("/messages/delete/{messageId}")
    Call<String> deleteMessage(@Path("messageId") Long messageId);

    @PUT("/messages/update/{messageId}/read")
    Call<Message> updateMessageStatus(@Path("messageId") Long messageId, @Query("isRead") Boolean isRead);

    @GET("/messages/list/{receiverId}")
    Call<List<Message>> listMessagesByReceiverId(@Path("receiverId") Long receiverId);

    @GET("/messages/latest/{receiverId}")
    Call<Message> getLatestMessageByFollowerId(@Path("receiverId") Long receiverId);
    //获取用户对话消息列表
    @GET("/messages/list/{senderId}/{receiverId}")
    Call<List<Message>> listMessagesBySenderAndReceiverId(@Path("senderId") Long senderId, @Path("receiverId") Long receiverId);
}